#include <stdio.h>
#include <string.h>

int n, k;
char status[1013] = {0};

int main()
{
    scanf("%i%i", &n, &k);
    memset(status, 0, sizeof(status));
    for (int i = 1; i <= k; ++i)
    {
        for (int j = 0; j <= n; j += i)
        {
            status[j] = !status[j];
        }
    }
    int count = 0;
    for (int i = 1; i <= n; ++i)
    {
        if (status[i])
            printf(" %i" + (i == 1), i);
    }
    return 0;
}